package org.lalib.controller.form;

import java.util.ArrayList;
import java.util.Date;
import java.util.List;

import javax.faces.bean.SessionScoped;

import org.lalib.acquire.IControllerForm;
import org.lalib.entity.object.EOrder;
import org.springframework.stereotype.Controller;

@SessionScoped
@Controller("cOrderReportForm")
public class COrderReportForm implements IControllerForm {

	private static final long serialVersionUID = 1L;

	private Date startDate = new Date();
	private Date endDate = new Date();
	private List<EOrder> orders = new ArrayList<>();
	private List<OrderReportBean> orderBeans = new ArrayList<>();

	public Date getStartDate() {
		return startDate;
	}

	public void setStartDate(Date startDate) {
		this.startDate = startDate;
	}

	public Date getEndDate() {
		return endDate;
	}

	public void setEndDate(Date endDate) {
		this.endDate = endDate;
	}

	public List<EOrder> getOrders() {
		return orders;
	}

	public void setOrders(List<EOrder> orders) {
		this.orders = orders;
	}

	public List<OrderReportBean> getOrderBeans() {
		return orderBeans;
	}

	public void setOrderBeans(List<OrderReportBean> orderBeans) {
		this.orderBeans = orderBeans;
	}

	public class OrderReportBean {
		private EOrder order;
		private Double price;

		public OrderReportBean(EOrder order, Double price) {
			setOrder(order);
			setPrice(price);
		}

		public EOrder getOrder() {
			return order;
		}

		public void setOrder(EOrder order) {
			this.order = order;
		}

		public Double getPrice() {
			return price;
		}

		public void setPrice(Double price) {
			this.price = price;
		}
	}

}
